import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/createEnterprise',
      name: 'createEnterprise',
      component: () => import('@/views/enterprise/CreateEnterpriseView.vue')
    },
    {
      path: '/editEnterprise',
      name: 'editEnterprise',
      component: () => import('@/views/enterprise/EditEnterpriseView.vue')
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('@/views/AccountViews/RegisterView.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/AccountViews/LoginView.vue')
    },
    {
      path: '/position',
      name: 'position',
      component: () => import('@/views/staff/position.vue')
    },
    {
      path: '/addstaff',
      name: 'addstaff',
      component: () => import('@/views/staff/addstaff.vue')
    },
    {
      path: '/listall',
      name: 'listall',
      component: () => import('@/views/staff/listall.vue')
    },
    {
      path: '/enterprise',
      name: 'enterprise',
      component: () => import('@/views/enterprise/EnterpriseInfoView.vue')
    },
    {
      path: '/personalinfo',
      name: 'personalinfo',
      component: () => import('@/views/tl/PersonalInfo.vue')
    },
    {
      path: '/message',
      name: 'message',
      component: () => import('@/views/messageView.vue')
    },
    // {
    //   path: '/search/post',
    //   name: 'searchPost',
    //   component: () => import('@/views/SearchView/PostSearchView.vue')
    // },
    // {
    //   path: '/search/position',
    //   name: 'searchPosition',
    //   component: () => import('@/views/SearchView/PositionSearchView.vue')
    // },
    {
      path: '/search',
      name: 'search',
      component: () => import('@/views/SearchView/SearchResultView.vue')
    },
    {
      path: '/personalpost',
      name: 'personalpost',
      component: () => import('@/views/PostView/UserPostView.vue')
    },
    {
      path: '/post',
      name: 'post',
      component: () => import('@/views/PostView/PostDetailView.vue')
    },
    {
      path: '/resumeOp',
      name: 'resumeOp',
      component: () => import('@/components/model/ResumeOp.vue')
    },
    {
      path: '/chat',
      name: 'chat',
      component: () => import('@/views/ChatView/ChatView.vue')
    },
    {
      path: '/candidates',
      name: 'candidates',
      component: () => import('@/views/tl/Candidates.vue')
    },
  ]
})

export default router
